{% extends "base.html" %}
{% block content %}
{% load static %}
<link href="{% static 'css/device_detail.css' %}" type="text/css" rel='stylesheet' />

<div class="detail">
    <h1>{{ device_info.ip_address }}信息</h1>
    <form method="post">
    {% csrf_token %}
    <table class="table table-hover">
        <thead><tr class="table-primary">
            <th scope="col" width="5%">ID</th>
            <th scope="col" width="10%">IP地址</th>
            <th scope="col" width="10%">主机名</th>
            <th scope="col" width="10%">用户名</th>
            <th scope="col" width="10%">密码</th>
            <th scope="col" width="5%">端口号</th>
            <th scope="col" width="5%">厂商</th>
        </tr></thead>

        <tbody>
        <tr class="table-info" style="line-height:40px">
            <th scope="row">{{device_info.id}}</th>
<!--            placeholder="{{device_info.port}}" 作为背景显示，不会被提交-->
            <td><input type="text" class="form-control" name="ip" value="{{device_info.ip_address}}"></td>
            <td><input type="text" class="form-control" name="hostname" value="{{device_info.hostname}}"></td>
            <td><input type="text" class="form-control" name="username" value="{{device_info.username}}"></td>
            <td><input type="text" class="form-control" name="pwd" value="{{device_info.password}}"></td>
            <td><input type="text" class="form-control" name="port" value="{{device_info.port}}"></td>
            <td>
                <select class="form-select" aria-label="Default select example" name="vendor">
                    <option selected>{{my_vendor}}</option>
                    {% for other in other_vendor %}
                        <option value="{{other}}">{{other}}</option>
                    {% endfor %}
                </select>
            </td>
        </tr>
        </tbody>
    </table>
    <button type="submit" class="btn btn-primary">提交</button>
    <a type="submit" class="btn btn-primary" href="http://127.0.0.1:8000/dev_list">返回</a>
    </form>

</div>

{% endblock %}